package com.xiaoxu.privatechat.dao.admin;

import com.xiaoxu.privatechat.entity.admin.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @description 后台角色数据库操作层
 * @date 2023/2/13
 * @author xiaoxu
 */
@Repository
public interface RoleDao extends JpaRepository<Role, Long> {

	/**
	 * @description 根据角色id查询角色
	 * @param id 角色id
	 * @return Role
	 */
	@Query("select r from Role r where r.id = :id")
	Role find(@Param("id")Long id);
}
